package com.ruoyi.storeExpend.service.impl;

import java.util.Date;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.storeExpend.mapper.StoreExpendMapper;
import com.ruoyi.storeExpend.domain.StoreExpend;
import com.ruoyi.storeExpend.service.IStoreExpendService;

/**
 * 商家消费明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-21
 */
@Service
public class StoreExpendServiceImpl implements IStoreExpendService 
{
    @Autowired
    private StoreExpendMapper storeExpendMapper;

    /**
     * 查询商家消费明细
     * 
     * @param id 商家消费明细主键
     * @return 商家消费明细
     */
    @Override
    public StoreExpend selectStoreExpendById(Long id)
    {
        return storeExpendMapper.selectStoreExpendById(id);
    }

    /**
     * 查询商家消费明细列表
     * 
     * @param storeExpend 商家消费明细
     * @return 商家消费明细
     */
    @Override
    public List<StoreExpend> selectStoreExpendList(StoreExpend storeExpend)
    {
        return storeExpendMapper.selectStoreExpendList(storeExpend);
    }

    /**
     * 新增商家消费明细
     * 
     * @param storeExpend 商家消费明细
     * @return 结果
     */
    @Override
    public int insertStoreExpend(StoreExpend storeExpend)
    {
        storeExpend.setCreateTime(DateUtils.getNowDate());
        return storeExpendMapper.insertStoreExpend(storeExpend);
    }

    /**
     * 修改商家消费明细
     * 
     * @param storeExpend 商家消费明细
     * @return 结果
     */
    @Override
    public int updateStoreExpend(StoreExpend storeExpend)
    {
        storeExpend.setUpdateTime(DateUtils.getNowDate());
        return storeExpendMapper.updateStoreExpend(storeExpend);
    }

    /**
     * 批量删除商家消费明细
     * 
     * @param ids 需要删除的商家消费明细主键
     * @return 结果
     */
    @Override
    public int deleteStoreExpendByIds(Long[] ids)
    {
        return storeExpendMapper.deleteStoreExpendByIds(ids);
    }

    /**
     * 删除商家消费明细信息
     * 
     * @param id 商家消费明细主键
     * @return 结果
     */
    @Override
    public int deleteStoreExpendById(Long id)
    {
        return storeExpendMapper.deleteStoreExpendById(id);
    }

    @Override
    public List<StoreExpend> getStoreExpendList(StoreExpend storeExpend, Date beginCreateTime, Date endCreateTime) {
        return storeExpendMapper.getStoreExpendList(storeExpend,beginCreateTime,endCreateTime);
    }
}
